Static variables: 

Recap: non-static instance variables vs static instance variables
Non static instance variables:
class Die {
	private int faceValue;

}

Die die1 = new Die(); // die1 is a 1st instance
Die die2 = new Die(); // die2 is a 2nd instance

die1 has its own copy of the faceValue, which is different from the one 
owned by die2

Static instance variables:
Slogan {
	private String phrase;
	private static int count = 0;

	public Slogan(String phrase) {
		this.phrase = phrase;
		count++;
	}

	...
	public static int getCount() {
		return count;
	}

}

Slogan slg1 = new Slogan("Just do it");
Slogan slg2 = new Slogan("Live free or die");

There will be only one copy of the variable called count, which will be shared
among all the instances of the class that you create. 

Slogan.getCount(); // This returns the value of the count variable

methods		static		non-static
variables
static		Yes		Yes

non-static	No		Yes

Driver class:

static main method

+ 

Supporting method for main (cannot be non-static) ---> This has to be static; otherwise 
compiler complains since in Java, static methods can only use static members of the class. 

- Class relationships: 
Design patterns 

Relationships to be covered include: 
a) Dependency (uses); b) Inheritance (is a): class-based + interface-based; 
c) Aggregation (has a) 

- Dependency: 

Class A (for example: RollingDice) is said to be dependent on Class B (for instance: Die)

Definition: Class A depends on Class B, if one or more methods of Class A is/are using
one or more methods of Class B

RollingDice {
	main() {
		....
		die1.roll()
		die1.getFaceValue()
		...
	}

}

Self-dependency: 
It is when an object (str1) of some class (String) interacts with another object (str2)
of the same class through a method (concat) defined in that class

str1.concat(str2); // String is an example of a self-dependent class

Application#1: RationalNumberDriver.java and RationalNumber.java

1/2 is a rational number: numerator (int) + denominator (int)

r1.add(r2);
r1.multiply(r2);
r1.divide(r2);
r1.subtract(r2);

Euclid's algorithm: 
3	7
2	4
1	1

- Method decomposition:

Pig Latin Translator

happy enough
appyhay	enoughyay	

Application#2:
PigLatinDriver.java
PigLatinTranslator.java























